using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Distance._Legacy
{
    /// <summary>
    /// <para>Cost Back Link</para>
    /// <para>Defines the neighbor that is the next cell on the least accumulative cost path to the least-cost source.</para>
    /// <para>定义相邻单元，该邻居是到成本最低源的累积成本最低路径上的下一个单元。</para>
    /// </summary>    
    [DisplayName("Cost Back Link")]
    public class CostBackLink : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CostBackLink()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_source_data">
        /// <para>Input raster or feature source data</para>
        /// <para><xdoc>
        ///   <para>The input source locations.</para>
        ///   <para>This is a raster or feature dataset that identifies the cells or locations from or to which the least accumulated cost distance for every output cell location is calculated.</para>
        ///   <para>For rasters, the input type can be integer or floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入源位置。</para>
        ///   <para>这是一个栅格或要素数据集，用于识别计算每个输出像元位置的最小累积成本距离的像元或位置。</para>
        ///   <para>对于栅格，输入类型可以是整数或浮点。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_cost_raster">
        /// <para>Input cost raster</para>
        /// <para><xdoc>
        ///   <para>A raster defining the impedance or cost to move planimetrically through each cell.</para>
        ///   <para>The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell.</para>
        ///   <para>The values of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义在每个像元中平面移动的阻抗或成本的栅格。</para>
        ///   <para>每个像元位置的值表示在像元中移动的单位距离成本。每个像元位置值乘以像元分辨率，同时还补偿对角线移动，以获得通过像元的总成本。</para>
        ///   <para>成本栅格的值可以是整数或浮点，但不能为负数或零（不能为负数或零成本）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_backlink_raster">
        /// <para>Output backlink raster</para>
        /// <para><xdoc>
        ///   <para>The output cost backlink raster.</para>
        ///   <para>The backlink raster contains values 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least-cost source.</para>
        ///   <para>If the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continue clockwise. The value 0 is reserved for source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出成本反向链接栅格。</para>
        ///   <para>反向链接栅格包含值 0 到 8，用于定义方向或标识下一个相邻像元（后续像元）沿累积成本最低的路径从像元到达其成本最低的来源。</para>
        ///   <para>如果路径要传递到右邻，则将为右下角对角线单元格分配值 1、2，并继续顺时针方向。值 0 保留给源单元格。</para>
        /// </xdoc></para>
        /// </param>
        public CostBackLink(object _in_source_data, object _in_cost_raster, object _out_backlink_raster)
        {
            this._in_source_data = _in_source_data;
            this._in_cost_raster = _in_cost_raster;
            this._out_backlink_raster = _out_backlink_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Cost Back Link";

        public override string CallName => "sa.CostBackLink";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_source_data, _in_cost_raster, _out_backlink_raster, _maximum_distance, _out_distance_raster, _source_cost_multiplier, _source_start_cost, _source_resistance_rate, _source_capacity, _source_direction];

        /// <summary>
        /// <para>Input raster or feature source data</para>
        /// <para><xdoc>
        ///   <para>The input source locations.</para>
        ///   <para>This is a raster or feature dataset that identifies the cells or locations from or to which the least accumulated cost distance for every output cell location is calculated.</para>
        ///   <para>For rasters, the input type can be integer or floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入源位置。</para>
        ///   <para>这是一个栅格或要素数据集，用于识别计算每个输出像元位置的最小累积成本距离的像元或位置。</para>
        ///   <para>对于栅格，输入类型可以是整数或浮点。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature source data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_source_data { get; set; }


        /// <summary>
        /// <para>Input cost raster</para>
        /// <para><xdoc>
        ///   <para>A raster defining the impedance or cost to move planimetrically through each cell.</para>
        ///   <para>The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell.</para>
        ///   <para>The values of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义在每个像元中平面移动的阻抗或成本的栅格。</para>
        ///   <para>每个像元位置的值表示在像元中移动的单位距离成本。每个像元位置值乘以像元分辨率，同时还补偿对角线移动，以获得通过像元的总成本。</para>
        ///   <para>成本栅格的值可以是整数或浮点，但不能为负数或零（不能为负数或零成本）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input cost raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cost_raster { get; set; }


        /// <summary>
        /// <para>Output backlink raster</para>
        /// <para><xdoc>
        ///   <para>The output cost backlink raster.</para>
        ///   <para>The backlink raster contains values 0 through 8, which define the direction or identify the next neighboring cell (the succeeding cell) along the least accumulative cost path from a cell to reach its least-cost source.</para>
        ///   <para>If the path is to pass into the right neighbor, the cell will be assigned the value 1, 2 for the lower right diagonal cell, and continue clockwise. The value 0 is reserved for source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出成本反向链接栅格。</para>
        ///   <para>反向链接栅格包含值 0 到 8，用于定义方向或标识下一个相邻像元（后续像元）沿累积成本最低的路径从像元到达其成本最低的来源。</para>
        ///   <para>如果路径要传递到右邻，则将为右下角对角线单元格分配值 1、2，并继续顺时针方向。值 0 保留给源单元格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output backlink raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_backlink_raster { get; set; }


        /// <summary>
        /// <para>Maximum distance</para>
        /// <para><xdoc>
        ///   <para>The threshold that the accumulative cost values cannot exceed.</para>
        ///   <para>If an accumulative cost distance value exceeds this value, the output value for the cell location will be NoData. The maximum distance is the extent for which the accumulative cost distances are calculated.</para>
        ///   <para>The default distance is to the edge of the output raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>累计成本值不能超过的阈值。</para>
        ///   <para>如果累计成本距离值超过此值，则像元位置的输出值将为 NoData。最大距离是计算累计成本距离的范围。</para>
        ///   <para>默认距离为到输出栅格的边缘。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _maximum_distance { get; set; } = null;


        /// <summary>
        /// <para>Output distance raster</para>
        /// <para><xdoc>
        ///   <para>The output cost distance raster.</para>
        ///   <para>The cost distance raster identifies, for each cell, the least accumulative cost distance over a cost surface to the identified source locations.</para>
        ///   <para>A source can be a cell, a set of cells, or one or more feature locations.</para>
        ///   <para>The output raster is of floating-point type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出成本距离栅格。</para>
        ///   <para>成本距离栅格可识别每个像元到已识别源位置的成本图面上的最小累积成本距离。</para>
        ///   <para>源可以是一个像元、一组像元或一个或多个要素位置。</para>
        ///   <para>输出栅格为浮点类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output distance raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_distance_raster { get; set; } = null;


        /// <summary>
        /// <para>Multiplier to apply to costs</para>
        /// <para><xdoc>
        ///   <para>The multiplier to apply to the cost values.</para>
        ///   <para>This allows for control of the mode of travel or the magnitude at a source. The greater the multiplier, the greater the cost to move through each cell.</para>
        ///   <para>The values must be greater than zero. The default is 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>应用于成本值的乘数。</para>
        ///   <para>这允许控制行进方式或源的大小。乘数越大，通过每个单元格移动的成本就越大。</para>
        ///   <para>这些值必须大于零。默认值为 1。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Multiplier to apply to costs")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_cost_multiplier { get; set; } = null;


        /// <summary>
        /// <para>Start cost</para>
        /// <para><xdoc>
        ///   <para>The starting cost from which to begin the cost calculations.</para>
        ///   <para>Allows for the specification of the fixed cost associated with a source. Instead of starting at a cost of zero, the cost algorithm will begin with the value set by Start cost.</para>
        ///   <para>The values must be zero or greater. The default is 0.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>开始成本计算的起始成本。</para>
        ///   <para>允许指定与源关联的固定成本。成本算法不是从零开始，而是从开始成本设置的值开始。</para>
        ///   <para>这些值必须为零或更大。默认值为 0。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start cost")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_start_cost { get; set; } = null;


        /// <summary>
        /// <para>Accumulative cost resistance rate</para>
        /// <para><xdoc>
        ///   <para>This parameter simulates the increase in the effort to overcome costs as the accumulative cost increases. It is used to model fatigue of the traveler. The growing accumulative cost to reach a cell is multiplied by the resistance rate and added to the cost to move into the subsequent cell.</para>
        ///   <para>It is a modified version of a compound interest rate formula that is used to calculate the apparent cost of moving through a cell. As the value of the resistance rate increases, it increases the cost of the cells that are visited later. The greater the resistance rate, the more additional cost is added to reach the next cell, which is compounded for each subsequent movement. Since the resistance rate is similar to a compound rate and generally the accumulative cost values are very large, small resistance rates are suggested, such as 0.02, 0.005, or even smaller, depending on the accumulative cost values.</para>
        ///   <para>The values must be zero or greater. The default is 0.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此参数模拟随着累积成本的增加而增加克服成本的努力。它用于模拟旅行者的疲劳。到达一个电池的累积成本不断增长，乘以电阻率，并添加到进入后续电池的成本中。</para>
        ///   <para>它是复利利率公式的修改版本，用于计算通过单元格的表观成本。随着电阻率值的增加，它增加了以后访问的电池的成本。阻力率越大，到达下一个单元的额外成本就越多，每次后续运动都会增加成本。由于电阻率与复合率相似，并且通常累积成本值非常大，因此建议根据累积成本值使用较小的电阻率，例如0.02、0.005甚至更小。</para>
        ///   <para>这些值必须为零或更大。默认值为 0。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Accumulative cost resistance rate")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_resistance_rate { get; set; } = null;


        /// <summary>
        /// <para>Capacity</para>
        /// <para><xdoc>
        ///   <para>The cost capacity for the traveler for a source.</para>
        ///   <para>The cost calculations continue for each source until the specified capacity is reached.</para>
        ///   <para>The values must be greater than zero. The default capacity is to the edge of the output raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>旅行者对源的成本容量。</para>
        ///   <para>继续计算每个源的成本，直到达到指定的容量。</para>
        ///   <para>这些值必须大于零。默认容量为输出栅格的边缘。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Capacity")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_capacity { get; set; } = null;


        /// <summary>
        /// <para>Travel direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction of the traveler when applying the source resistance rate and the source starting cost.</para>
        ///   <bulletList>
        ///     <bullet_item>Travel from source—The source resistance rate and source starting cost will be applied beginning at the input source, and travel out to the non-source cells. This is the default.</bullet_item><para/>
        ///     <bullet_item>Travel to source—The source resistance rate and source starting cost will be applied beginning at each non-source cell, and travel back to the input source.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>If you select the String option, you can choose between from and to options, which will be applied to all sources.</para>
        ///   <para>If you select the Field option, you can select the field from the source data that determines the direction to use for each source. The field must contain the text string FROM_SOURCE or TO_SOURCE.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定施加源电阻率和源启动成本时行走者的方向。</para>
        ///   <bulletList>
        ///     <bullet_item>从源头移动 - 源电阻率和源启动成本将从输入源开始应用，并传输到非源电池。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>流向源 - 源电阻率和源启动成本将从每个非源电池开始应用，并返回输入源。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>如果选择“字符串”选项，则可以在“从”和“到”选项之间进行选择，这些选项将应用于所有源。</para>
        ///   <para>如果选择“字段”选项，则可以从源数据中选择用于确定每个源使用方向的字段。该字段必须包含文本字符串 FROM_SOURCE 或 TO_SOURCE。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _source_direction { get; set; } = null;


        public CostBackLink SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}